/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dale2507.gates.gate;

import dale2507.gates.data.Settings;
import org.bukkit.Material;

/**
 *
 * @author Dale
 */
public class GateSettings {
    
    /**
     * Represents a public gate. Visible to everyone and usable by everyone
     */
    public static final int PUBLIC = 0;
    /**
     * Represents a hidden gate. Visible only to the owner and people with permission. Usable by everyone
     */
    public static final int HIDDEN = 1;
    /**
     * Represents a private gate. Visible and usable only by the owner and people with permission.
     */
    public static final int PRIVATE = 2;
    
    private String name;
    private Address address;
    private Address autodial;
    private Material torchType;
    private Material irisKey;
    private boolean indefinite;
    
    private String owner;
    private int visibility;
    
    public GateSettings(Display display, DHD dhd, String owner) {
        this(display.getName(), dhd.getAddress(), dhd.getAutoDialAddress(), dhd.getTorchType(), dhd.getIrisKey(), owner, display.getVisibility(), dhd.isIndefinite());
    }

    public GateSettings(String name, Address address, Address autodial, Material torchType, Material irisKey, String owner, int visibility, boolean indefinite) {
        this.name = name;
        this.address = address;
        this.autodial = autodial;
        this.torchType = torchType;
        if (this.torchType != null && this.torchType.getId() == 0) this.torchType = null;
        this.irisKey = irisKey;
        this.owner = owner;
        this.visibility = visibility;
        this.indefinite = indefinite;
    }

    public String getName() {
        return name;
    }

    public Address getAddress() {
        return address;
    }

    public Address getAutoDialAddress() {
        return autodial;
    }

    public Material getTorchType() {
        Material m = torchType;
        if (m == null) m = Settings.getInstance().creation.defaultChevronTorch();
        return m;
    }

    public Material getIrisKey() {
        return irisKey;
    }

    public boolean isIndefinite() {
        return indefinite;
    }

    public String getOwner() {
        return owner;
    }

    public int getVisibility() {
        return visibility;
    }
    
}
